import {createReducer} from '../../../redux/createReducer'
const User_Info_fetch_Memo = 'User_Info_fetch_Memo'
const User_Info_change_Test = 'User_Info_change_Test'


const store = {
  state: {
    memo: 9,
    test: 0
  },
  action: {
     fetchMemo (params) {
      return {
        type: User_Info_fetch_Memo,
        callAPI: {url: 'http://stage-mapi.yimifudao.com/statistics/cc/kpi', params, config: {}},
        payload: params
      }
    },
     changeTest (params) {
      return {
        type: User_Info_change_Test,
        payload: params
      }
    }
  },
  reducer: {
    [User_Info_fetch_Memo] (prevState = {}, {payload}) {
      console.log('reducer--->',payload)
      return {
        ...prevState,
        memo: payload.memo
      }
    },
    [User_Info_change_Test] (prevState = {}, {payload}) {
      return {
        ...prevState,
        test: payload.test
      }
    }
  }
}


export default createReducer(store)
export const action = store.action

